﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Silvermoon.Controls
{
    /// <summary>
    /// Event args to synchronize two controls which implement ISynchronizable.
    /// </summary>
    public class SyncEventArgs : EventArgs
    {

        public float Offset { get; private set; }
        public INavigationNode Node { get; private set; }
        public SynEventReason Reason { get; private set; }

        public SyncEventArgs(INavigationNode node, float offset, SynEventReason type)
            : base()
        {
            this.Node = node;
            this.Offset = offset;
            this.Reason = type;
        }

    }

    /// <summary>
    /// Specifies the reason for syncronization.
    /// </summary>
    public enum SynEventReason
    {
        /// <summary>
        /// Synchronization due to paning of the offset in the source control.
        /// </summary>
        Pan,

        /// <summary>
        /// Synchronization since the source control navigates to another node using a relative offset from the current node.
        /// </summary>
        NavigateTo,

        /// <summary>
        /// Synchronization due to changing the SelectedNode of the source control.
        /// </summary>
        Select
    }
}
